#!/bin/bash
#

#把.jpg文件改名为.php
for old_file in $(find /opt/test -name "*.jpg"); do
    qianzhui=$(echo $old_file | awk -F. '{print $1}')
    new_file=${qianzhui}.php
    mv ${old_file} ${new_file}
done
